package com.chenjun.core.vo.sys;

import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.util.Date;

import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.beans.BeanUtils;

import com.chenjun.core.dao.generator.entity.SysUser;


@SuppressWarnings("serial")
public class UserDto implements Serializable{
	
    /**
     * 用户管理表（管理员）  
     * db_column: id 
     */	
	private String id;
    /**
     * 登陆名  
     * db_column: user_name 
     */
	@NotEmpty(message="登陆名不能为空")
	private String userName;
    /**
     * 真实姓名  
     * db_column: real_name 
     */	
	@NotEmpty(message="用户名不能为空")
	private String realName;
    /**
     * 密码  
     * db_column: password 
     */
//	@NotEmpty(message="密码不能为空")
	private String password;
	
	private String repassword;
	
	private String oldPassword;
    /**
     * 盐钥  
     * db_column: salt 
     */	
	private String salt;
    /**
     * 是否启用(0:启用；1:禁用)  
     * db_column: disabled 
     */	
	private String disabled;
    /**
     * 工号  
     * db_column: user_num 
     */	
	@NotEmpty(message="工号不能为空")
	private String userNum;
    /**
     * 性别  
     * db_column: sex 
     */	
	private String sex;
    /**
     * 地区  
     * db_column: area 
     */	
	private String area;
    /**
     * 职位编号  
     * db_column: position_num 
     */	
	private String positionNum;
    /**
     * 电话  
     * db_column: phone 
     */	
	private String phone;
    /**
     * 地址  
     * db_column: address 
     */	
	private String address;
    /**
     * 出生日期  
     * db_column: birthday 
     */	
	private String birthday;
    /**
     * 入职时间  
     * db_column: entry_time 
     */	
	private Date entryTime;
    /**
     * 照片地址路径  
     * db_column: img_url 
     */	
	private String imgUrl;
    /**
     * 学历  
     * db_column: education 
     */	
	private String education;
    /**
     * 是否离职  
     * db_column: dimission_status 
     */	
	private String dimissionStatus;
    /**
     * 资产设备编号  
     * db_column: equipment_num 
     */	
	private String equipmentNum;
    /**
     * 邮件  
     * db_column: email 
     */	
	private String email;
    /**
     * 部门  
     * db_column: department 
     */	
	private String department;
    /**
     * 创建时间  
     * db_column: created_time 
     */	
	private Date createdTime;
    /**
     * 更新时间  
     * db_column: update_time 
     */	
	private Date updateTime;
	
	private String roleId;
	
	private String officeId;
	
	private String userType;
	
	private String isDelete;
	
	/**
	 * 组织机构
	 */
	private String groupId;
	/**
	 * 职位级别
	 */
	private String positionLevel;

	public void setId(String id) {
		this.id = id == null ? null : id.trim();
	}
	
	public String getId() {
		return this.id;
	}
	public void setUserName(String userName) {
		this.userName = userName == null ? null : userName.trim();
	}
	
	public String getUserName() {
		return this.userName;
	}
	public void setRealName(String realName) {
		this.realName = realName == null ? null : realName.trim();
	}
	
	public String getRealName() {
		return this.realName;
	}
	public void setPassword(String password) {
		this.password = password == null ? null : password.trim();
	}
	
	public String getPassword() {
		return this.password;
	}
	
	public String getRepassword() {
		return repassword;
	}

	public void setRepassword(String repassword) {
		this.repassword = repassword;
	}

	public String getOldPassword() {
		return oldPassword;
	}

	public void setOldPassword(String oldPassword) {
		this.oldPassword = oldPassword;
	}

	public void setSalt(String salt) {
		this.salt = salt == null ? null : salt.trim();
	}
	
	public String getSalt() {
		return this.salt;
	}
	public void setDisabled(String disabled) {
		this.disabled = disabled == null ? null : disabled.trim();
	}
	
	public String getDisabled() {
		return this.disabled;
	}
	public void setUserNum(String userNum) {
		this.userNum = userNum == null ? null : userNum.trim();
	}
	
	public String getUserNum() {
		return this.userNum;
	}
	public void setSex(String sex) {
		this.sex = sex == null ? null : sex.trim();
	}
	
	public String getSex() {
		return this.sex;
	}
	public void setArea(String area) {
		this.area = area == null ? null : area.trim();
	}
	
	public String getArea() {
		return this.area;
	}
	public void setPositionNum(String positionNum) {
		this.positionNum = positionNum == null ? null : positionNum.trim();
	}
	
	public String getPositionNum() {
		return this.positionNum;
	}
	public void setPhone(String phone) {
		this.phone = phone == null ? null : phone.trim();
	}
	
	public String getPhone() {
		return this.phone;
	}
	public void setAddress(String address) {
		this.address = address == null ? null : address.trim();
	}
	
	public String getAddress() {
		return this.address;
	}
	public void setBirthday(String birthday) {
		this.birthday = birthday == null ? null : birthday.trim();
	}
	
	public String getBirthday() {
		return this.birthday;
	}
	public void setEntryTime(Date entryTime) {
		this.entryTime = entryTime;
	}
	
	public Date getEntryTime() {
		return this.entryTime;
	}
	public void setImgUrl(String imgUrl) {
		this.imgUrl = imgUrl == null ? null : imgUrl.trim();
	}
	
	public String getImgUrl() {
		return this.imgUrl;
	}
	public void setEducation(String education) {
		this.education = education == null ? null : education.trim();
	}
	
	public String getEducation() {
		return this.education;
	}
	public void setDimissionStatus(String dimissionStatus) {
		this.dimissionStatus = dimissionStatus == null ? null : dimissionStatus.trim();
	}
	
	public String getDimissionStatus() {
		return this.dimissionStatus;
	}
	public void setEquipmentNum(String equipmentNum) {
		this.equipmentNum = equipmentNum == null ? null : equipmentNum.trim();
	}
	
	public String getEquipmentNum() {
		return this.equipmentNum;
	}
	public void setEmail(String email) {
		this.email = email == null ? null : email.trim();
	}
	
	public String getEmail() {
		return this.email;
	}
	public void setDepartment(String department) {
		this.department = department == null ? null : department.trim();
	}
	
	public String getDepartment() {
		return this.department;
	}
	public void setCreatedTime(Date createdTime) {
		this.createdTime = createdTime;
	}
	
	public Date getCreatedTime() {
		return this.createdTime;
	}
	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
	
	public Date getUpdateTime() {
		return this.updateTime;
	}
	
	public String getRoleId() {
		return roleId;
	}

	public void setRoleId(String roleId) {
		this.roleId = roleId;
	}
	
	public String getOfficeId() {
		return officeId;
	}

	public void setOfficeId(String officeId) {
		this.officeId = officeId;
	}

	public String getUserType() {
		return userType;
	}

	public void setUserType(String userType) {
		this.userType = userType;
	}

	public String getIsDelete() {
		return isDelete;
	}

	public void setIsDelete(String isDelete) {
		this.isDelete = isDelete;
	}

	public String getGroupId() {
		return groupId;
	}

	public void setGroupId(String groupId) {
		this.groupId = groupId;
	}

	public String getPositionLevel() {
		return positionLevel;
	}

	public void setPositionLevel(String positionLevel) {
		this.positionLevel = positionLevel;
	}

	/**
	 * 根据Bean获取Model模型
	 * @return
	 * PayBean
	 * @throws InvocationTargetException 
	 * @throws IllegalAccessException 
	 */
	public static UserDto getDtoByModel(SysUser source) throws IllegalAccessException, InvocationTargetException{
		UserDto target = new UserDto();
		BeanUtils.copyProperties(source, target);
		return target;
	}
	
	
	/**
	 * 根据Model获取Bean模型
	 * @return
	 * PayBean
	 * @throws InvocationTargetException 
	 * @throws IllegalAccessException 
	 */
	public static SysUser getModelByDto(UserDto source) throws IllegalAccessException, InvocationTargetException{
		SysUser target = new SysUser();
		BeanUtils.copyProperties(source, target);
		return target;
	}
	
	/**
	 * 根据Dto获取Bean模型
	 * @return
	 * PayBean
	 * @throws InvocationTargetException 
	 * @throws IllegalAccessException 
	 */
	public static UserBean getBeanByDto(UserDto source) throws IllegalAccessException, InvocationTargetException{
		UserBean target = new UserBean();
		BeanUtils.copyProperties(source, target);
		return target;
	}

}
